{include file="public/_meta" /}
<link href="/static/admin/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>会员管理 <span class="c-gray en">&gt;</span> 添加会员 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<form class="form form-horizontal" id="form-article-add" >
        <input type="hidden" name="__token__" value="{$Request.token}" />
        <input type="hidden" name="apply_type" value="2" />
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">推荐人信息：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" placeholder="填写推荐人手机号" name="ptel" id="ptel" style="width:20%">
                <div class="btn btn-primary radius" onclick="confirmP()">确认</div>
                <p id="confirmP"></p>
			</div>

		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>昵称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" name="us_nickname" class="input-text" style="width:20%">
			</div>
		</div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>手机号码：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" name="us_tel" style="width:20%">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>支付宝账号：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" name="ali_account" style="width:20%">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>微信账号：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" name="we_account" style="width:20%">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>身份证号：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" name="us_id_card" style="width:20%">
            </div>
        </div>

<!--        <div class="row cl">-->
<!--                <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>头像：</label>-->
<!--                <div class="formControls col-xs-8 col-sm-9">-->
<!--                    <div style="width:110px;height: 110px;position: relative;display: inline-block; ">-->
<!--                        <img src="/static/admin/img/head3.jpg" alt="" class="logo" style="position: absolute;left: 0;top: 0;width: 100%;height: 100%;">-->
<!--                        <input type="file" name="file" onchange="eee($(this))" class="input-text" style="position: absolute;left: 0;top: 0;width: 100%;height: 100%;opacity: 0;">-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
            <div style="display:none" class="ttt">
                <input type="text" name="us_head_pic" value="">
            </div>
        <div class="row cl" style="display: none;">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>登录密码：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" name="us_pwd" value="123456" style="width:20%">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>交易密码：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" name="us_pay_pwd" style="width:20%">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>角色类型：</label>
            <div class="formControls col-xs-8 col-sm-9"> 
                <span class="select-box" style="width:20%">
                    <select name="us_type"  class="select">
                        <option value="1">会员</option>
                        <option value="2">店主</option>
                        <option value="3">运营中心</option>
                    </select>
                </span>
            </div>
        </div>
        <!-- <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"></label>
            <div class="formControls col-xs-8 col-sm-9"> 
                <span class="select-box" style="width:20%">
                    <span class="c-red">如果会员类型为商户，则需要审核后拥有发布商品权</span>
                </span>
            </div>
        </div>       -->

		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button onclick="return add();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 确认提交</button><!--  -->
			</div>
		</div>
	</form>
</div>

{include file="public/_footer" /}

<!--请在下方写此页面业务相关的脚本-->

<script type="text/javascript">

function add(){
    $.post('{:url("add")}',$('#form-article-add').serialize()).success(function(data){
    	layer.msg(data.msg);
    	if(data.code){
    		setTimeout(function(){
    			location.href = '';
    		},1000);
    	}
    });
    return false;
}
function eee(dada) {
        var data = new FormData();
        data.append('file', dada[0].files[0]);
        var index = layer.load(1, { shade: false }); //0代表加载的风格，支持0-2
        $.ajax({
            url: '{:url("store/upload")}',
            type: 'POST',
            data: data,
            cache: false,
            contentType: false,
            processData: false,
            success: function(data) {
                layer.msg(data.msg);
                if (data.code) {
                    $('.logo').attr('src',data.data);
                    $('input[name="us_head_pic"]').val(data.data);
                }
                layer.close(index);
            },
            error: function() {
                layer.close(index);
                layer.msg('上传出错');
            }
        });
    }
function confirmP(){
    var val = $('#ptel').val();
    $.ajax({
        url: '{:url("confirmP")}',
        type: 'POST',
        data: {ptel:val},
        success: function(data) {
            if (data.code) {
                $('#confirmP').html(data.msg);
                $('#confirmP').css({"color":"black"});
            }else{
                $('#confirmP').html(data.msg);
                $('#confirmP').css({"color":"red"});
            }
        },
    });
}

</script>
</body>
</html>